This invention relates to a position loop gain control method for deciding the gain of a digital-to-analog converter, which constitutes a position loop, in such a manner that the gain of the position loop assumes a set value, the position loop being part of a spindle orientation apparatus for stopping a spindle at a prescribed orientation.
The capability of stopping a spindle at a prescribed orientation is required in a machine tool. As an example, in a machining center with ATC (automatic tool-change function), it is necessary to stop a spindle at a prescribed orientation in order to change a tool mounted on the spindle. To cut a screw hole, bore, keyway or the like into a workpiece mounted on a spindle in a turning center, it is necessary that the workpiece, namely the spindle, be brought to rest at a prescribed orientation.
To this end, various spindle orientation control apparatus have been proposed. FIG. 1 is a block diagram of a spindle orientation circuit for controlling a turning center, and FIG. 2 is an operation time chart of the same. When a turning operation is performed, a digital command velocity V.sub.c produced by an NC unit, not shown, enters a velocity command circuit 101a incorporating a DA converter and the like, where V.sub.c is converted into an analog command velocity CVA. This is then applied to a spindle motor 102 via a changeover switch 101b and a velocity control circuit 101c, thereby rotating the spindle motor. The actual velocity of the spindle motor 102 is sensed by a tachometer 103, emerging from the latter as a velocity feedback signal AVA, which is applied to the velocity control circuit 101c. The latter rotates the spindle motor 102 at the command velocity V.sub.c.
When the stage is reached at which a spindle 105 is to be brought to a stop at a prescribed orientation at the conclusion of turning machining, the NC unit, not shown, issues an orientation command ORCM and the command velocity V.sub.c becomes an initial orientation velocity (V.sub.ORi). As a result, the rotational velocity of the spindle motor 102 is decelerated down to the initial orientation velocity V.sub.ORi. When the output of an arithmetic circuit ARM, described below, attains a predetermined value after the initial orientation velocity is reached, a changeover circuit 101d changes over a movable contact of the changeover switch 101b to a contact B. An orientation controller 101e is adapted to produce a position deviation voltage RPD (analog voltage) which conforms to a deviation between a prescribed spindle position and the current spindle position. When the changeover switch 101b is changed over to the contact B, the velocity control circuit 101c produces a difference voltage between the position deviation voltage RPD and the actual velocity AVA and performs servo position control in such a manner that the position deviation voltage takes on a value of zero. When the position deviation voltage RPD reaches zero, a monitoring circuit 101f produces a spindle orientation end signal ORDEN. Thus, a position control feedback loop is constructed by the velocity control circuit 101c, spindle motor 102, position coder 104, orientation controller 101e and changeover switch 101b, with the spindle 105 being positioned at the prescribed orientation thereby. In the orientation controller 101e, a counter CNT is set to a numerical value N when the position coder 104 generates a one-revolution signal RP. Then, each time an A-phase pulse PA is generated, the status of the counter is decremented. It should be noted that N is a number, e.g., 4096, of A-phase pulses generated by the position coder 104 during one revolution of the spindle. The arithmetic circuit ARM executes the addition of a numerical value N.sub.s from the counter CNT, and a numerical value N.sub.c corresponding to a commanded spindle stopping position. DAC denotes a digital-to-analog converter (referred to as a DA converter) for generating the position deviation voltage RPD, which corresponds to a numerical value N.sub.r produced by the arithmetic circuit. The DA converter DAC is adapted to produce an output of zero volts when N.sub.r is 2048, of -V.sub.b (volts) when N.sub.r is 0, and an output of +V.sub.b (volts) when N.sub.r is 4096. In a case where it is desired to stop the spindle at an intermediate position (180.degree. position) where the number of A-phase pulses produced will be 2048 starting from the position at which the one-revolution pulse RP is generated, the operation N.sub.c =0 is performed and the orientation controller 101e produces the position deviation voltage RPD, which is a sawtooth signal (see the solid line in FIG. 2) that crosses the zero level at a position 180.degree. from the position at which the one-revolution signal is generated. Further, the operation N.sub.c =-1048 is performed if is desired to stop the spindle at a position 90.degree. from the position at which the one-revolution signal is generated, the operation N.sub.c =1048 is performed when it is desired to stop the spindle at a position 270.degree. from the position at which the one-revolution signal is generated, and, in each case, the position deviation signal RPD is produced, with the signal being as illustrated by the one-dot chain line line in FIG. 2 in the former case and by the dashed line in the latter.
Assume that the spindle is desired to be stopped at the position 180.degree. from the position at which the one-revolution signal is generated. If the spindle 105 is being rotated at the initial orientation velocity V.sub.ORi, then, when the output of the arithmetic circuit ARM becomes 4096, the changeover circuit 101d senses the fact and changes over the movable contact of the changeover switch 101b to the contact B. When the numerical value applied thereto is 4096, the DA converter DAC produces the voltage V.sub.b, which is equivalent to the initial orientation velocity V.sub.ORi. Therefore, when the switch 101b is changed over (i.e., when there is a changeover from velocity control to position control), the input voltage of the velocity control circuit 101c makes a smooth transition, after which the spindle 105 is subjected to position control and stopped at the commanded prescribed orientation.
If the position loop gain in the spindle orientation circuit does not possess an appropriate value, overshoot or hunting (due to excessively high gain) occurs at positioning, and servo rigidity when the spindle is at rest at the prescribed orientation is weakened (due to low gain), so that the spindle is easily moved by an external force.
Position loop gain is dependent upon load inertia seen from the motor, and load inertia differs from machine to machine and from one spindle speed reduction stage to another even in one and the same machine. In the conventional spindle orientation circuit, therefore, position loop gain is adjusted by manually controlling the gain of an amplifier in the position loop as well as the characteristic of the DA converter whenever the machine is changed and whenever the spindle speed reduction stage is changed.
However, the above-described conventional method of adjustment involves a troublesome adjustment operation since the position loop must be adjusted manually whenever the machine is changed and whenever the spindle speed reduction stage is changed.